package com.service.impl;

import com.mapper.PurchaseMasterMapper;
import com.pojo.PurchaseMaster;
import com.service.PurchaseMasterService;
import com.util.Pager;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@Service("purchaseMasterService")
public class PurchaseMasterServiceImpl implements PurchaseMasterService {
    @Resource
    private PurchaseMasterMapper purchaseMasterMapper;
    @Override
    public Pager<PurchaseMaster> searchByPurchaseMaster() {
        Pager<PurchaseMaster> pager =new Pager<>();
        pager.setTotal(purchaseMasterMapper.total());
        pager.setRows(purchaseMasterMapper.searchByPurchaseMaster());
        return pager;
    }

    @Override
    public PurchaseMaster get(String id) {
        return purchaseMasterMapper.get(id);
    }

    @Override
    public int update(PurchaseMaster purchaseMaster) {
        return purchaseMasterMapper.update(purchaseMaster);
    }
}
